package com.tsinghua.discharge.controller;

import com.tsinghua.discharge.common.ServerResponse;
import com.tsinghua.discharge.service.DeleteFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpSession;

@RestController
@RequestMapping("/delete")
public class DeleteFileController {
    @Autowired
    DeleteFileService deleteFileService;
    @RequestMapping(value = "/deleteFileByFileType.do",method = RequestMethod.POST)
    public ServerResponse deleteFileByFileType(String fileType,String supsector ,HttpSession session){
        if(fileType!=null&& !fileType.equals("")){
            return deleteFileService.deleteByFileType(fileType,supsector,session);
        }
        return ServerResponse.createByErrorMessage("文件类型不能为空");
    }
}
